unit untLogMovProdutos;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, untExibePadrao, DB, IBCustomDataSet, dxBarDBNav, dxBar,
  cxClasses, ActnList, cxPropertiesStore, cxContainer, cxEdit, cxStyles,
  cxGridTableView, cxLookAndFeels, cxGridCustomPopupMenu, cxGridPopupMenu,
  ImgList, cxGraphics, ExtCtrls, cxPC, cxControls, cxCustomData, cxFilter,
  cxData, cxDataStorage, cxDBData, cxGridCustomTableView,
  cxGridBandedTableView, cxGridDBBandedTableView, cxGridLevel,
  cxGridCustomView, cxGrid, cxGridExportLink, cxLookAndFeelPainters,
  dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinCaramel, dxSkinCoffee,
  dxSkinDarkRoom, dxSkinDarkSide, dxSkinFoggy, dxSkinGlassOceans,
  dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
  dxSkinMcSkin, dxSkinMoneyTwins, dxSkinOffice2007Black,
  dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
  dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
  dxSkinOffice2010Silver, dxSkinPumpkin, dxSkinSeven, dxSkinSharp,
  dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
  dxSkinsDefaultPainters, dxSkinValentine, dxSkinXmas2008Blue,
  dxSkinscxPCPainter, dxSkinsdxBarPainter;

type
  TfrmLogMovProduto = class(TfrmExibePadrao)
    dtEditPRODUTOR_NOME: TIBStringField;
    dtEditPRODUTO_NOME: TIBStringField;
    dtEditCODIGO: TIntegerField;
    dtEditPRODUTO: TIntegerField;
    dtEditQTDE: TIBBCDField;
    dtEditSALDO_ANT: TIBBCDField;
    dtEditSALDO: TIBBCDField;
    dtEditORIGEM: TIBStringField;
    dtEditDOCTO: TIBStringField;
    dtEditTIPO: TIBStringField;
    dtEditPROPRIEDADE: TIntegerField;
    dtEditDT_DOCTO: TDateField;
    dtEditDATA_HORA: TDateTimeField;
    dtEditPROPRIEDADE_NOME: TIBStringField;
    Grid: TcxGrid;
    GridDBBandedTableView1: TcxGridDBBandedTableView;
    GridDBBandedTableView2: TcxGridDBBandedTableView;
    GridLevel1: TcxGridLevel;
    GridDBBandedTableView2PRODUTOR_NOME: TcxGridDBBandedColumn;
    GridDBBandedTableView2PRODUTO_NOME: TcxGridDBBandedColumn;
    GridDBBandedTableView2CODIGO: TcxGridDBBandedColumn;
    GridDBBandedTableView2PRODUTO: TcxGridDBBandedColumn;
    GridDBBandedTableView2QTDE: TcxGridDBBandedColumn;
    GridDBBandedTableView2SALDO_ANT: TcxGridDBBandedColumn;
    GridDBBandedTableView2SALDO: TcxGridDBBandedColumn;
    GridDBBandedTableView2ORIGEM: TcxGridDBBandedColumn;
    GridDBBandedTableView2DOCTO: TcxGridDBBandedColumn;
    GridDBBandedTableView2TIPO: TcxGridDBBandedColumn;
    GridDBBandedTableView2PROPRIEDADE: TcxGridDBBandedColumn;
    GridDBBandedTableView2DT_DOCTO: TcxGridDBBandedColumn;
    GridDBBandedTableView2DATA_HORA: TcxGridDBBandedColumn;
    GridDBBandedTableView2PROPRIEDADE_NOME: TcxGridDBBandedColumn;
    procedure ActConfigurarExecute(Sender: TObject);
    procedure ActExportarExecute(Sender: TObject);
    procedure ActExpandirExecute(Sender: TObject);
    procedure ActContrairExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmLogMovProduto: TfrmLogMovProduto;

implementation

{$R *.dfm}

procedure TfrmLogMovProduto.ActConfigurarExecute(Sender: TObject);
begin
  inherited;
  TcxGridTableController(Grid.FocusedView.Controller).Customization := True;
end;

procedure TfrmLogMovProduto.ActExportarExecute(Sender: TObject);
begin
  inherited;
   with SaveDialog do
  begin
    DefaultExt := 'xls';
    Filter := '*.xls';
    FileName := 'Extrato Mov. de Produtos';
    if Execute then
      ExportGridToExcel(FileName,Grid);
  end;
end;

procedure TfrmLogMovProduto.ActExpandirExecute(Sender: TObject);
begin
  inherited;
  GridDBBandedTableView1.ViewData.Expand(True)
end;

procedure TfrmLogMovProduto.ActContrairExecute(Sender: TObject);
begin
  inherited;
  GridDBBandedTableView1.ViewData.Collapse(True);
end;

end.
